<template>

  <van-tabbar v-model="active" active-color="#ee0a24" inactive-color="#000">
    <van-tabbar-item to="/home" icon="wap-home-o">首页</van-tabbar-item>
    <van-tabbar-item to="/topic" icon="label-o">专题</van-tabbar-item>
    <van-tabbar-item to="/category" icon="qr">分类</van-tabbar-item>
    <van-tabbar-item to="/buycart" icon="cart-o">购物车</van-tabbar-item>
    <van-tabbar-item to="/user" icon="friends-o">我的</van-tabbar-item>
  </van-tabbar>
</template>

<script>
  export default {
    data() {
      return {

      }
    },
    computed: {
      active: {
        get() {
          switch (this.$route.path) {
            case "/home":
              return 0;
            case "/topic":
              return 1;
            case "/category":
              return 2;
            case "/buycart":
              return 3;
            case "/user":
              return 4;
          }
        },
        set(){}
      }
    }
  }
</script>

<style scoped>

</style>
